package com.xiaochong.bitong.api.controller;

import com.netflix.discovery.converters.Auto;
import com.xiaochong.bitong.api.service.VxRobotService;
import com.xiaochong.bitong.api.utils.ApiVersion;
import com.xiaochong.tir.common.data.po.CurrencyInfo;
import com.xiaochong.tir.common.data.vo.ApiResultVo;
import com.xiaochong.tir.common.data.vo.app.VxCurrencyMarketVo;
import com.xiaochong.tir.common.data.vo.app.VxCurrencyVo;
import com.xiaochong.tir.common.data.vo.app.VxGlobalIndexVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 机器人接口
 * @Author: org
 * @CreateDate: 2018/9/13 14:40
 */
@Api(value = "微信机器人接口")
@RestController
@RequestMapping(value = ApiVersion.API_V1_PREFIX+"/robot")
public class VxRobotController {

    @Autowired
    private VxRobotService vxRobotService;

    @ApiOperation(value = "获取货币集合" , notes = "获取货币集合")
    @PostMapping("getCurrencyCollects")
    public ApiResultVo<VxCurrencyVo> getCurrencyCollects(){
        return vxRobotService.getCurrencyCollects();
    }
    @ApiOperation(value = "获取货币行情" , notes = "获取货币行情")
    @PostMapping("getCurrencyMarket")
    public ApiResultVo<VxCurrencyMarketVo> getCurrencyMarket(String cmcId){
        return vxRobotService.getCurrencyMarket(cmcId);
    }
    @ApiOperation(value = "获取大盘指数" , notes = "获取大盘指数")
    @PostMapping("getCurrencyMarketIndex")
    public ApiResultVo<VxGlobalIndexVo> getCurrencyMarketIndex(){
        return vxRobotService.getCurrencyMarketIndex();
    }
    @ApiOperation(value = "图片上传" , notes = "图片上传")
    @PostMapping("uploadImage")
    public ApiResultVo uploadImage(String imageString,String cmcId){
        return vxRobotService.uploadImage(imageString,cmcId);
    }
    @ApiOperation(value = "获取图片路径" , notes = "获取图片路径")
    @PostMapping("getImageUrl")
    public ApiResultVo getImageUrl(String cmcId){
        return vxRobotService.getImageUrl(cmcId);
    }
}
